Demultiplexer

ABSTRACT

In a demultiplexer, a finite search length and a finite jump length are set in a packet header detection section. The packet header detection section skips from a transfer start position of a multiplexed stream according to the set jump length and then searches for a start code included in a packet header which is to be detected through a range designated by the search length. A payload separation section separates payloads included in the multiplexed stream based on detection results of the packet header detection section.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims priority under 35 U.S.C. § 119(a) on JapanesePatent Application No. 2004-244678 filed on Aug. 25, 2004, the entirecontents of the specification, drawings and claims of which are herebyincorporated by reference.

BACKGROUND OF THE INVENTION

The present invention relates to a demultiplexer for separating desireddata from a multiplexed stream.

In a DVD (Digital Versatile Disk) which is one of the optical disks,compressed/encoded data of video, sound, etc., is recorded. Data readout of the DVD is in the form of a multiplexed stream which is formed bya plurality of packets each including a packet header and a payload.Thus, a DVD player requires a demultiplexer for extracting a desiredpayload from the multiplexed stream and supplying the extracted payloadto a decoder for decompression.

If a correct payload, i.e., correct data, is not supplied to thedecoder, a decoding result of video, sound, or the like, includesdisturbances. In the worst case, there is a possibility that theoperation of the decoder stops (hangs).

According to a conventional technique disclosed in Japanese Laid-OpenPatent Publication No. 8-79709, synchronization recovery of a decoder isrealized based on sector synchronization information such that the timerequired for recovery since occurrence of an error is shortened.

In an optical disk compliant with the DVD standards, every packet headerincludes a start code without exception, and therefore, the packetheader can be detected by a demultiplexer without fail. Further, apayload can be separated without fail based on information included inthe packet header, such as payload length information, or the like.

However, in the case where an optical disk incompliant with the DVDstandards is placed in a DVD player, there is a possibility that ademultiplexer misdetects a packet header. In this case, a wrong payloadis supplied to a decoder. In the worst case, the decoder hangs asdescribed above. This problem also occurs when inputting of amultiplexed stream to the demultiplexer is started from the middle of apacket.

SUMMARY OF THE INVENTION

An objective of the present invention is to provide a demultiplexercapable of suppressing misdetection of a packet header.

In order to achieve this objective, according to the present invention,a finite search length or finite jump length is set in a packet headerdetection section, and a start code included in a packet header which isto be detected is searched for based on the search length or jumplength.

Specifically, the present invention is based on, as an assumption, ademultiplexer for extracting effective payloads from a multiplexedstream formed by a plurality of packets, each of which includes a packetheader and a payload, the demultiplexer comprising: a packet headerdetection section for detecting packet headers in the multiplexedstream; and a payload separation section for separating payloadsincluded in the multiplexed stream based on detection results of thepacket header detection section. In this demultiplexer, a finite searchlength is set in the packet header detection section, and the packetheader detection section searches for a start code included in a packetheader which is to be detected through a range designated by the searchlength.

Based on the above assumption, a finite jump length may be set in thepacket header detection section, and the packet header detection sectionskips from a transfer start position of the multiplexed stream accordingto the set jump length and then searches for a start code included in apacket header which is to be detected.

A start code of a packet is searched for through a range designated by asearch length. Thus, even if ineffective data exists between packets,misdetection of a packet header is suppressed while unnecessary searchfor a start code is avoided.

A start code of a packet is searched for after skipping from a transferstart position of a multiplexed stream according to a set jump length.Thus, even if inputting of the multiplexed stream is started from themiddle of the packet, misdetection of a packet header is suppressedwhile unnecessary search for a start code is avoided.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of a DVD player which uses a demultiplexeraccording to one embodiment of the present invention.

FIG. 2 shows an example of a multiplexed stream input to thedemultiplexer of FIG. 1.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

Hereinafter, an embodiment of the present invention is described withreference to the drawings.

FIG. 1 shows a DVD player which uses a demultiplexer according to oneembodiment of the present invention. The DVD player of FIG. 1 includes ademultiplexer 20 and an AV decoder 30. An optical disk 10 is placed atthe input side, and a video monitor 40 and a loudspeaker 41 areconnected to the output side. The demultiplexer 20 receives amultiplexed stream 11 from the optical disk 10. It should be noted thatan optical pickup, a demodulation circuit, an error correction circuit,etc., which are provided between the optical disk 10 and thedemultiplexer 20, are omitted from the drawing.

The demultiplexer 20 extracts effective payloads from the multiplexedstream 11 formed by a plurality of packets each including a packetheader and a payload and supplies the extracted payloads to the AVdecoder 30. The demultiplexer 20 includes a packet header detectionsection 21 and a payload separation section 22. Each packet has apayload which includes any of the following compressed/encoded data:primary video data, sound data, and secondary video data (subpictureincluding subtitle information). The packet header detection section 21sequentially detects the packet headers included in the multiplexedstream 11 based on a search length and a jump length previously set inthe packet header detection section 21. The payload separation section22 sequentially separates the payloads included in the multiplexedstream 11 based on detection results of the packet header detectionsection 21.

The AV decoder 30 decompresses a payload (compressed/encoded data)supplied from the demultiplexer 20 according to the attribute of thepayload. The AV decoder 30 includes a first buffer memory 31, a secondbuffer memory 32, a third buffer memory 33, a video decoder 34, an audiodecoder 35, a subpicture decoder 36 and a mixer 37. The first buffermemory 31 stores primary video payloads separated by the payloadseparation section 22. The second buffer memory 32 stores sound payloadsseparated by the payload separation section 22. The third buffer memory33 stores secondary video payloads separated by the payload separationsection 22. The video decoder 34 decodes primary video payloads outputfrom the first buffer memory 31. The audio decoder 35 decodes soundpayloads output from the second buffer memory 32. The subpicture decoder36 decodes secondary video payloads output from the third buffer memory33. The first buffer memory 31 is a bit buffer which is required by thevideo decoder 34 under the DVD standards. As well, the second buffermemory 32 is a bit buffer which is required by the audio decoder 35. Thethird buffer memory 33 is a bit buffer which is required by thesubpicture decoder 36. The mixer 37 synthesizes a decoding result of thevideo decoder 34 and a decoding result of the subpicture decoder 36 tosupply a signal which represents a result of the synthesis to the videomonitor 40. The loudspeaker 41 receives a sound signal from the audiodecoder 35.

FIG. 2 shows an example of the multiplexed stream 11 which is suppliedto the demultiplexer 20 of FIG. 1. FIG. 2 shows the first, second, thirdand fourth packets and ineffective data which exists between the firstpacket and the second packet. Segment PH1 is a first packet header,segment PL1 is a first payload, segment PH2 is a second packet header,segment PL2 is a second payload, segment PH3 is a third packet header,segment PL3 is a third payload, segment PH4 is a fourth packet header,and segment PL4 is a fourth payload. Each of the first to fourth packetheaders PH1 to PH4 is formed by a start code at the leading part of thepacket header and a subsequent part which contains header informationand packet information. The subsequent part includes information of thepayload length. Further, the multiplexed stream 11 includes unshownindex data. In the index data, the start position of each of the packetheaders PH1 to PH4 is written as an offset value from the leading end ofthe multiplexed stream 11.

Next, an operation of the demultiplexer 20 of FIG. 1 is described indetail on the assumption that all of the four packets which constitutethe multiplexed stream 11 shown in FIG. 2 relate to primary video data.

The search length set in the packet header detection section 21 isdetermined according to the length of ineffective data previous to apacket header which is to be detected by the packet header detectionsection 21. Herein, it is assumed that the search length is set inconsideration of a predicted length of the ineffective data shown inFIG. 2. The jump length set in the packet header detection section 21 iscalculated from a transfer start position of the multiplexed stream 11and a packet start position indicated by the index data included in themultiplexed stream 11. Herein, it is assumed that inputting of themultiplexed stream 11 is started from the leading end of the firstpacket. Thus, the set jump length is 0. It should be noted that at leastone of the search length and jump length which is to be set in thepacket header detection section 21 may be supplied from the outside ofthe demultiplexer 20.

The packet header detection section 21 searches for a start codeincluded in the first packet header PH1 through a range designated bythe search length to detect the first packet header PH1 without error.The payload separation section 22 separates the first payload PL1without error based on the payload length information included in thedetected first packet header PH1. The separated first payload PL1 isstored in the first buffer memory 31.

Next, the packet header detection section 21 searches for a start codeincluded in the second packet header PH2 after jumping over theineffective data subsequent to the first payload PL1. That is, thepacket header detection section 21 searches for a start code through arange designated by the search length, whereby it is possible to skipthe ineffective data to detect the second packet header PH2 withouterror. Herein, even if data which is the same as the start code of thesecond packet header PH2 is included in the ineffective data previous tothe second packet header PH2, the true start code of the second packetheader PH2 is found because the start code of the second packet headerPH2 is searched for through the range designated by the search length.The payload separation section 22 separates the second payload PL2without error not based on false information of the payload length whichis obtained from the ineffective data but based on the correct payloadlength information included in the detected second packet header PH2.The separated second payload PL2 is stored in the first buffer memory31.

Thereafter, in the same way, the third and fourth packet headers PH3 andPH4 are detected without error, and after every detection, the third andfourth payloads PL3 and PL4 are separated without error, respectively.The separated third and fourth payloads PL3 and PL4 are stored in thefirst buffer memory 31.

Alternatively, a plurality of search lengths may be set in the packetheader detection section 21, and the plurality of search lengths may beselectively used according to the attribute of a payload which is to beseparated. If the length of ineffective data previous to a packet headerwhich is to be detected is long (for example, in the case of primaryvideo data), a long search length is selected. If the length ofineffective data previous to a packet header which is to be detected isshort (for example, in the case of sound data), a short search length isselected. In the case where misdetection of a packet header is likely tooccur, a long search length is preferably selected by the packet headerdetection section 21. In the case where misdetection of a packet headeris unlikely to occur, a short search length is preferably selected bythe packet header detection section 21.

Lastly, an example where a finite jump length other than 0 is set in thepacket header detection section 21 is described. For example, wheninputting of a multiplexed stream 11 is started from the middle of thesecond payload PL2 of FIG. 2, the jump length set in the packet headerdetection section 21 is calculated from the relationship between thetransfer start position of the multiplexed stream 11 (an intermediateposition of the second payload PL2) and the start position of the thirdpacket which is indicated by the index data included in the multiplexedstream 11. Thus, the packet header detection section 21 skips to theleading end of the third packet header PH3 and then searches for a startcode included in the third packet header PH3 through a range designatedby the search length, whereby the third packet header PH3 can bedetected without error. That is, even if data which is the same as thestart code of the third packet header PH3 is included in a rangeextending from the transfer start position of the multiplexed stream 11to the trailing end of the second payload PL2, the true start code ofthe third packet header PH3 can be found out.

In the case where index data is placed at the trailing end of themultiplexed stream 11, the above-described operation including thecalculation of the jump length may be performed after the multiplexedstream 11 is entirely buffered in the demultiplexer 20.

As described above, a demultiplexer of the present invention has such anadvantage that misdetection of a packet header is suppressed whileunnecessary search for a start code is avoided and is therefore usefulfor optical disk players, magnetic disk players, and the like. Further,the present invention is also applicable to systems which usemultiplexed streams, such as digital broadcasting, internetcommunications, etc.

1. A demultiplexer for extracting effective payloads from a multiplexedstream formed by a plurality of packets, each of which includes a packetheader and a payload, the demultiplexer comprising: a packet headerdetection section for detecting packet headers in the multiplexedstream; and a payload separation section for separating payloadsincluded in the multiplexed stream based on detection results of thepacket header detection section, wherein a finite search length is setin the packet header detection section, and the packet header detectionsection searches for a start code included in a packet header which isto be detected through a range designated by the search length.
 2. Thedemultiplexer of claim 1, wherein: a plurality of search lengths are setin the packet header detection section; and the packet header detectionsection selectively uses the plurality of search lengths such that ifthe length of ineffective data previous to a packet header which is tobe detected is long, the packet header detection section selects a longsearch length, and if the length of ineffective data previous to apacket header which is to be detected is short, the packet headerdetection section selects a short search length.
 3. The demultiplexer ofclaim 1, wherein the search length is externally set.
 4. A demultiplexerfor extracting effective payloads from a multiplexed stream formed by aplurality of packets, each of which includes a packet header and apayload, the demultiplexer comprising: a packet header detection sectionfor detecting packet headers in the multiplexed stream; and a payloadseparation section for separating payloads included in the multiplexedstream based on detection results of the packet header detectionsection, wherein a finite jump length is set in the packet headerdetection section, and the packet header detection section skips from atransfer start position of the multiplexed stream according to the setjump length and then searches for a start code included in a packetheader which is to be detected.
 5. The demultiplexer of claim 4, whereinthe jump length set in the packet header detection section is calculatedfrom a relationship between a transfer start position of the multiplexedstream and a packet start position indicated by index data included inthe multiplexed stream.
 6. The demultiplexer of claim 4, wherein thejump length is externally set.
 7. A demultiplexer for extractingeffective payloads from a multiplexed stream formed by a plurality ofpackets, each of which includes a packet header and a payload, thedemultiplexer comprising: a packet header detection section fordetecting packet headers in the multiplexed stream; and a payloadseparation section for separating payloads included in the multiplexedstream based on detection results of the packet header detectionsection, wherein a finite search length and a finite jump length are setin the packet header detection section, and the packet header detectionsection skips from a transfer start position of the multiplexed streamaccording to the set jump length and then searches for a start codeincluded in a packet header which is to be detected through a rangedesignated by the search length.
 8. The demultiplexer of claim 7,wherein the jump length set in the packet header detection section iscalculated from a relationship between a transfer start position of themultiplexed stream and a packet start position indicated by index dataincluded in the multiplexed stream.
 9. The demultiplexer of claim 7,wherein the jump length is externally set.
 10. The demultiplexer ofclaim 7, wherein: a plurality of search lengths are set in the packetheader detection section; and the packet header detection sectionselectively uses the plurality of search lengths such that if the lengthof ineffective data previous to a packet header which is to be detectedis long, the packet header detection section selects a long searchlength, and if the length of ineffective data previous to a packetheader which is to be detected is short, the packet header detectionsection selects a short search length.
 11. The demultiplexer of claim 7,wherein the search length is externally set.